<?php
require "../common.php";
$id = $_GET['id'];
$result = $mysqli->query("select * from `article` where `id`='$id'");
$row = $result->fetch_assoc();

if ($_POST){
    $title = $_POST['title'];
    $content = $_POST['content'];
    $time = time();
    $mysqli->query("update `article` set `title`='$title',`content`='$content' where `id`='$id'");
    echo "<script>alert('编辑成功！');location.href='article.php';</script>";
}



require "templates/edit.html";